using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
public partial class pages_Spot : PagedPage
{
    public override string  RequestString
{
	get { return "Place.aspx?cate_id"+Request["cate_id"]+"&page="; }
}

    protected void Page_Load(object sender, EventArgs e)
    {
        SpotDAO daoSpot=new SpotDAO();
        p = Request["page"];
        totals = 0;
        currentPage = GetPageNumber(p);
        if (Request["cate_id"] != null)
        {
            int cate_id = int.Parse(Request["cate_id"]);
            rptSpotList.DataSource = daoSpot.GetSpotsByCategory(currentPage, pageSize, ref totals, cate_id, ServiceObject.Published);
            rptSpotList.DataBind();
        }
        else if (Request["id"] != null)
        {
            int id = int.Parse(Request["id"]);
            List < Spot > list= new List<Spot>();
            list.Add(daoSpot.GetSpot(id));
            rptSpotDetails.DataSource = list;
            rptSpotDetails.DataBind();
            if (IsPersolnel)
            {
                if (rptSpotDetails.Items.Count > 0)
                {
                    ((Panel)rptSpotDetails.Items[0].FindControl("pnlEdit")).Visible = true;
                }
            }
        }
    }
}
